package com.icss.day05;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import javax.annotation.Resource;
import java.util.Date;


@Configuration
//@Scope("single")
@Scope("prototype")
public class B {

    public static final Logger log = LoggerFactory.getLogger(B.class);

//    @Autowired
//    @Qualifier(value = "ddd")
//    D d1;

    @Resource(name = "ddd")
    D d1;

    @Bean
    // 参数可以注入
    public Date myDate(C c1) {
        log.debug("进入方法");
        System.out.println("@@@@" + c1);
        System.out.println("@@@@" + d1);
        log.debug("方法执行完成");
        return  new Date();
    }
}
